
#ifndef Triangle_h
#define Triangle_h

#include "Primitive.h"
#include "Point.h"
class Ray;

class Triangle : public Primitive {
 public:
  Triangle(Material* material, const Point& corner1, const Point& corner2, const Point& corner3);
  virtual ~Triangle();

  virtual void getBounds(BoundingBox& bBox) const;
  virtual void intersect(HitRecord& hit, const RenderContext& context, const Ray& ray) const;
  virtual void normal(Vector& normal, const RenderContext& context,
                      const Point& hitpos, const Ray& ray, const HitRecord& hit) const;
 protected:
  Point corner1;
  Point corner2;
  Point corner3;
};

#endif
